﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PStock.aspx.cs" Inherits="Skyworth.CRM.Web.BasicData.PStock" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>仓库管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <%--[if IE]>
     <link href="../themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]--%>
    <link href="../themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/pages.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <link href="../themes/css/Messagebox.css" rel="stylesheet" type="text/css" />

    <script src="../javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../javascripts/MessageBox.js" type="text/javascript"></script>
    <script src="../javascripts/jquery.tablesorter.min.js" type="text/javascript"></script>
    <script src="../javascripts/wbox.js" type="text/javascript"></script>
    <script type="text/javascript" >
        var addWindow;
        $(document).ready(function () {

            //        $("div.button").hover(function() { $(this).addClass("buttonHover"); },
            //                                 function() { $(this).removeClass("buttonHover"); });
            $("div.buttonActive").hover(function () { $(this).addClass("buttonActiveHover"); },
                                function () { $(this).removeClass("buttonActiveHover"); })

            $("ul.toolBar li").hover(function () { $(this).addClass("hover"); },
                                              function () { $(this).removeClass("hover"); })
            //绑定表格行事件                        
            $(".tableList table.list").tablesorter();


            $(".tableList table.list tbody tr:nth-child(even)").attr('class', "trbg");
            $(".tableList table.list tbody tr").hover(function () { $(this).addClass("hover"); },
                                            function () { $(this).removeClass("hover"); }).click(function () {
                                                $(this).addClass("selected")
                                                $(this).siblings().removeClass("selected");
                                                $("#selectedStockID").val($(this).attr("rel"));
                                            }).dblclick(function () {
                                                addWindow = $("#selectedStockID").wBox({ title: "修改仓库信息", requestType: "iframe", target: "EditPStock.aspx?Type=update&StockId=" + $(this).attr("rel"), iframeWH: { width: 600, height: 300} });
                                                addWindow.showBox();
                                            });

            //绑定更新和删除按钮事件
                                            addWindow = $("#btnAdd").wBox({ title: "新增仓库信息", requestType: "iframe", target: "EditPStock.aspx?Type=add", iframeWH: { width: 600, height: 300} });

            $("#btnUpdate").click(function () {
                if ($(this).attr("disabled") != "disabled") {
                    var stockId = $("#selectedStockID").val();
                    if (parseInt(stockId) > 0) {
                        addWindow = $("#selectedStockID").wBox({ title: "修改仓库信息", requestType: "iframe", target: "EditPStock.aspx?Type=update&StockId=" + stockId, iframeWH: { width: 600, height: 300} });
                        addWindow.showBox();
                    }
                    else {
                        $.Messager.Alert({ Title: '系统消息', Message: "请选择要修改的仓库！", Icon: IconType.Warning });
                    }
                    return false;
                }
            })

            $("#btnDelete").click(function () {
                if ($(this).attr("disabled") != "disabled") {
                    var brandId = $("#selectedStockID").val();
                    if (parseInt(brandId) > 0) {
                        $.Messager.Confirm({ Title: '系统警告', Message: '你确定要删除该仓库信息吗?', Icon: IconType.Question,
                            Oncallback: function (IsYes, siteMapId) {
                                if (IsYes) { $("#btnhidDelete").trigger("click"); }
                            }
                        })
                    }
                    else {
                        $.Messager.Alert({ Title: '系统消息', Message: "请选择要删除的仓库！", Icon: IconType.Warning });
                    }
                    return false;
                }
            })

        })
    </script>
</head>
<body style="background-color: #FFF">
    <form id="form1" runat="server">
    <div>
       <table width="100%">
            <tr>
                <td>
                    <div class="searchBar" style="padding: 4px 5px;">
                        <ul>
                            <li style="float: left;"><span>仓库代码：</span>
                                <asp:TextBox ID="txtStockCode" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left;"><span>仓库名称：</span>
                                <asp:TextBox ID="txtStockName" runat="server"></asp:TextBox>
                            </li>
                            <li style="float: left;">
                                <span >类型：</span>
                                <asp:DropDownList ID="ddlstType" runat="server">
                                    <asp:ListItem Selected="True" Value="0">请选择</asp:ListItem>
                                    <asp:ListItem Value="1">客户</asp:ListItem>
                                    <asp:ListItem Value="2">分公司</asp:ListItem>
                                    <asp:ListItem Value="3">总部</asp:ListItem>
                                </asp:DropDownList>
                            </li>
                            <li style="float: left;">
                                <span >状态：</span>
                                <asp:DropDownList ID="ddlstStatus" runat="server">
                                    <asp:ListItem Selected="True" Value="0">请选择</asp:ListItem>
                                    <asp:ListItem Value="1">确认</asp:ListItem>
                                    <asp:ListItem Value="2">部分关闭</asp:ListItem>
                                    <asp:ListItem Value="3">关闭</asp:ListItem>
                                </asp:DropDownList>
                            </li>
                            <li style="float: left; padding-left: 20px">
                                <div class="buttonActive">
                                    <div class="buttonContent">
                                        <asp:Button ID="btnSearch" runat="server" Text="查询" ToolTip="查询仓库信息" CssClass="serverButton"
                                            OnClick="btnSearch_Click" />
                                    </div>
                                </div>
                            </li>
                            <li style="clear: both" ></li>
                        </ul>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                <div class="pageContent">
                    <div class="panelBar">
                        <ul class="toolBar">
                            <li class=""><asp:LinkButton ID="btnAdd" runat="server" CssClass="add"><span>添加仓库信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class=""><asp:LinkButton ID="btnUpdate" runat="server" CssClass="edit"><span>修改仓库信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class=""><asp:LinkButton ID="btnDelete" runat="server" CssClass="delete"><span>删除仓库信息</span> </asp:LinkButton></li>
                            <li class="line">line</li>
                            <li class="">
                                <asp:Button ID="btnhidDelete" runat="server" Text="" Style="display: none;" OnClick="btnhidDelete_Click" />
                                <input type="hidden" style="display: none;" id="selectedStockID" runat="server" />
                            </li>
                        </ul>
                    </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="pageContent" style="_margin-top: -2px;">
                        <div class="tableList">
                            <table class="list" width="100%">
                                <thead>
                                    <tr>                                        
                                        <th  style="cursor: pointer;">
                                            <span style="float: left">仓库代码</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th width="200" style="cursor: pointer;" class="headerSortUp" >
                                            <span style="float: left">仓库名称</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">类型</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>   
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">部门</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>    
                                        <%--<th style="cursor: pointer;"  >
                                            <span style="float: left">客户</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>    --%>
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">状态</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th> 
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">地址</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>    
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">财务联系人</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>    
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">仓库联系人</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">电话</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th> 
                                        <th style="cursor: pointer;"  >
                                            <span style="float: left">手机</span> <span style="float: right;" class="sortIcon">
                                            </span>
                                        </th>                                           
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Literal ID="litStockList" runat="server"></asp:Literal>
                                </tbody>
                                <tfoot>
                                </tfoot>
                            </table>
                        </div>                       
                    </div>
                </td>
            </tr>           
        </table>
    </div>
    </form>
</body>
</html>